import http from '@/utils/http'
const commonStudyService = {
  // 获取用户权限
  getPower(params) {
    return http.get('/ban/study_registration/user_msg', params)
  },
  // 获取用户信息
  getStudyIndex(params) {
    return http.get('/ban/study_center/student_power/subject_powers', params)
  },
  //获取新版私教学习中心入学报到信息
  getCommonInformation(params) {
    return http.get('/ban/study_center/register/information_fill', params)
  },
  // 提交入学信息
  submitCommonInformation(params) {
    return http.post('/ban/study_center/register/information_fill', params)
  },
  //获取学习中心课程包信息
  getCoursePackageInfo(params) {
    return http.get('/ban/study_center/course/course_package', params)
  },
  //获取权限看课数据统计
  getCourseStat(params) {
    return http.post('/ban/study_center/student_course/total_stat', params)
  },
  //记录上一次观看
  recordLastWatch(params) {
    return http.post('/ban/study_center/course/last_watch_log', params)
  },
  //获取记录上一次观看
  getLastWatch(params) {
    return http.post('/ban/study_center/course/last_watch', params)
  },
  // 学习计划
  // 计划日期统计
  getDateScheduleList(params) {
    return http.post(
      '/ban/study_center/student_plan/date_schedule_stat',
      params
    )
  },
  // 指定日期的任务
  getDaySchedule(params) {
    return http.post('/ban/study_center/student_plan/day_schedule', params)
  },
  // 讲义列表
  getNotesList(params) {
    return http.get('/ban/study_center/resource/notes', params)
  },
  // 资料包列表
  getPackageList(params) {
    return http.get('/ban/study_center/resource/package', params)
  },
  //获取添加客服
  getCourseDetailAddKefu() {
    return http.get('/wxpub/api/check_user_kefu')
  },
  // 通用学习中心题库列表
  getQuestionBankList(params) {
    return http.get(
      '/ban/study_center/question_bank/question_bank_list',
      params
    )
  },
  // 获取科目权限下题库汇总数据
  getUserExamSummary(params) {
    return http.get(
      '/ban/study_center/question_bank_data/user_exam_summary',
      params
    )
  },
  // 科目权限看课数据统计汇总
  getUserTotalStat(params) {
    return http.post('/ban/study_center/student_course/total_stat', params)
  },
  // 课包看课数据统计
  getCoursePackageStat(params) {
    return http.post(
      '/ban/study_center/student_course/course_package_stat',
      params
    )
  },
  // 课程收藏列表
  getCourseCollectList(params) {
    return http.post('/ban/study_center/student_course/course_collects', params)
  },
  // 题库统计数据
  getExamStatistics(params) {
    return http.get(
      '/ban/study_center/question_bank_data/user_exam_statistics',
      params
    )
  },
  // 课程下的老师
  getCourseTeachers(params) {
    return http.post('/ban/study_center/student_course/course_teachers', params)
  },
  // 课程看课数据统计
  getCourseStats(params) {
    return http.post('/ban/study_center/student_course/course_stat', params)
  },
  // 获取错题列表
  getExamWrongList(params) {
    return http.get('/ban/study_center/question_bank_data/wrong_list', params)
  },
  // 删除错题
  delExamWrong(params) {
    return http.post('/ban/study_center/question_bank_data/del_wrong', params)
  },
  // 试题笔记列表
  getExamNoteList(params) {
    return http.get('/ban/study_center/question_bank_data/note_list', params)
  },
  // 删除试题笔记
  delExamNote(params) {
    return http.post('/wxpub/api_base/delete_note_exam', params)
  },
  // 题库收藏列表
  getExamCollectList(params) {
    return http.get('/ban/study_center/question_bank_data/collect_list', params)
  },
  // 题库收藏删除 || 看课收藏删除
  delExamCollect(params) {
    return http.post('/wxpub/api_base/delete_user_collect', params)
  },
  // 课程笔记列表
  getCourseNoteList(params) {
    return http.post('/ban/study_center/student_course/course_notes', params)
  },
  // 删除看课笔记
  delCourseNote(params) {
    return http.post('/wxpub/api_base/delete_note_course', params)
  },
  // 题库统计明细数据
  getBankStatistics(params) {
    return http.get(
      '/ban/study_center/question_bank_data/question_bank_statistics',
      params
    )
  },
  /** 题库的目录和试卷结构
   * 传统题库{exam_type,subject_id}
   * 通用学习中心题库{subject_power_id，subject_id，question_bank_id}
   * 随堂练习题库{course_id，question_bank_id，teacher_id，subject_power_id}
   *  */
  getBankInfo(params) {
    // 传统题库目录信息
    if (+params.exam_type < 9) {
      return http.get('/wxpub/api/exam_directory', params)
    }
    // 随堂练习题库
    if (+params.exam_type === 10) {
      return http.get('/ban/study_center/question_bank/in_class_list', params)
    }
    // 通用学习中心题库
    return http.get(
      '/ban/study_center/question_bank/question_bank_tree',
      params
    )
  },
  /**
   * getDirectory 传统题库目录信息
   */
  getDirectory(params) {
    return http.get('/wxpub/api/exam_directory', params)
  },

  //展示直播列表前置数据 - 下拉选项
  getLiveIndexSelect(params) {
    return http.get(
      '/ban/study_center/study_live_data/live_index_select',
      params
    )
  },
  //展示直播列表数据
  getLiveIndexList(params) {
    return http.get('/ban/study_center/study_live_data/live_index_list', params)
  },
  // 直播看课记录统计
  getLiveStat(params) {
    return http.post('/ban/study_center/student_course/live_stat', params)
  },
  // 设置做题正确次数
  postQuestionWrongConfig(params) {
    return http.post('wxpub/api_base/question_wrong_config', params)
  },
  // 获取做题正确次数
  getQuestionWrongConfig(params) {
    return http.get('wxpub/api_base/question_wrong_config', params)
  }
}
export default commonStudyService
